{% extends 'base.html' %}
{% block list-main %}
    <div class="container-fluid">
        <div class="row">
            <div class="col-sm-3 col-md-2 sidebar">
                <ul class="nav nav-sidebar">
                    <li><a href="/publisher_list/">出版社列表</a></li>
                    <li><a href="/book_list/">书籍列表</a></li>
                    <li class="active"><a href="/author_list/">作者列表</a></li>
                    <li><a href="#">ccc</a></li>
                </ul>

            </div>
            <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
                <h1 class="page-header">作者列表</h1>

                <div class="panel panel-primary">
                    <!-- Default panel contents -->
                    <div class="panel-heading">作者列表 <i class="fa fa-thumb-tack pull-right"></i></div>
                    <div class="panel-body">
                        <div class="row" style="margin-bottom: 15px">
                            <div class="col-md-4">
                                <div class="input-group">
                                    <input type="text" class="form-control" placeholder="Search for...">
                                    <span class="input-group-btn">
                                    <button class="btn btn-default" type="button">搜索</button>
                                </span>
                                </div><!-- /input-group -->
                            </div><!-- /.col-md-4 -->
                            <div class="pull-right">
                                <a href="/add_author/" class="btn btn-success">添加作者</a>
                            </div>

                        </div><!-- /.row -->

                        <table class="table table-bordered">
                            <thead>
                                <tr>
                                    <th>序号</th>
                                    <th>id</th>
                                    <th>作者名称</th>
                                    <th>代表作</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                            {% for author in author_list %}
                                <tr>
                                    <td>{{ forloop.counter }}</td>
                                    <td>{{ author.id }}</td>
                                    <td>{{ author.name }}</td>
                                    <td>
                                        {% load app01_filters %}
                                        {{ author|A2bTrans }}
                                    </td>
                                    <td>
                                        <a class="btn btn-danger" href="/del_author/?id={{ author.id }}">删除</a>
                                        <a class="btn btn-info" href="/edit_author/?id={{ author.id }}">编辑</a>
                                    </td>
                                </tr>
                            {% endfor %}
                            </tbody>
                        </table>

                        <nav aria-label="Page navigation" class="text-right">
                            <ul class="pagination">
                                <li>
                                    <a href="#" aria-label="Previous">
                                        <span aria-hidden="true">&laquo;</span>
                                    </a>
                                </li>
                                <li><a href="#">1</a></li>
                                <li><a href="#">2</a></li>
                                <li><a href="#">3</a></li>
                                <li><a href="#">4</a></li>
                                <li><a href="#">5</a></li>
                                <li>
                                    <a href="#" aria-label="Next">
                                        <span aria-hidden="true">&raquo;</span>
                                    </a>
                                </li>
                            </ul>
                        </nav>
                    </div>

                </div>
            </div>
        </div>
    </div>
{% endblock %}